package cn.common.exceptions;

/**
 * Copyright
 *
 * @Author WuHuang
 * @Date 2022/12/22
 */

/**
 * 描述用途
 *
 * @author levikang
 * @date 2020/03/20
 */
public class FailErrorCode implements ErrorCode {
    String desc;

    private FailErrorCode(String desc) {
        this.desc = desc;
    }

    @Override
    public String getCode() {
        return BaseErrorCode.FAIL.getCode();
    }

    @Override
    public String getDescription() {
        return this.desc;
    }

    public static FailErrorCode build(String desc) {
        return new FailErrorCode(desc);
    }

    public static ErrorCode build(String code, String desc) {
        return new ErrorCode() {
            @Override
            public String getCode() {
                return code;
            }

            @Override
            public String getDescription() {
                return desc;
            }
        };
    }


}
